home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / Shareware World / Comms & Internet / LinkConverter 1.1.2 / Dialog Director v0.7 / Res Utils Examples / DD Save.as < prev    next >
Encoding:
Text File  |  1998-02-17  |  1.2 KB  |  26 lines  |  [TEXT/ToyS]

  1. on PetDialog(petName, petType, petRelation)
  2.     return {size:[270, 226], name:"My Pets", style:movable dialog, default item:1, contents:[¬
  3.         {class:push button, bounds:[40, 192, 98, 212], name:"OK"}, ¬
  4.         {class:push button, bounds:[168, 192, 226, 212], name:"Cancel"}, ¬
  5.         {class:text field, bounds:[72, 16, 259, 32], name bounds:[8, 16, 57, 32], name:"name:", value:petName}, ¬
  6.         {class:radio group, bounds:[26, 48, 130, 66], button offset:[120, 16], max down:4, contents:¬
  7.             ["cat", "dog", "weasel", "snake", "moose", "parakeet", "squirrel", "gila monster"], value:petType}, ¬
  8.         {class:radio group, bounds:[26, 142, 126, 158], button offset:[120, 16], max down:2, contents:¬
  9.             ["love", "hate", "who cares?", "get along"], value:petRelation}, ¬
  10.         {class:group box, name:"Relation with:", bounds:[10, 124, 260, 180], style:secondary group} ¬
  11.             ]}
  12. end PetDialog
  13.  
  14. on run
  15.     set dlog to PetDialog("Abbey", 3, 1)
  16.     set f to new file default name "DD Test Dialog"
  17.     res create f creator type "DiDi" file type "DiDi"
  18.     set rf to res open f with write permission
  19.     try
  20.         res put rf id 1000 data dlog name "Pet Dialog"
  21.     on error number n
  22.         res close rf
  23.         error number n
  24.     end try
  25.     res close rf
  26. end run